<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="ex">
			<h1>Name:{{fullname}}</h1>
		</div>
		<script type="text/javascript">
			var demo=new Vue(
				{
					el:'#ex',
					data:{
						surname:'Tango',
						name:'Zulu'
					},
					computed:{
						fullname:{
							/* getter方 */
							get:function(){
								return this.surname + this.name;
							},
							/* setter方 */
							set:function(value){
								this.surname=value.substr(0,1);
								this.name=value.substr(1);
							}
						}
					}
				}
			);
			demo.fullname='TANGO_TANG';
		</script>
	</body>
</html>
